package com.es.www.cglib.service.controller;

import org.apache.catalina.User;
import org.springframework.cglib.proxy.Enhancer;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.es.www.cglib.service.UserManager;
import com.es.www.cglib.service.advice.CglibProxy;
import com.es.www.cglib.service.impl.UserManagerImpl;

/**
 * @Created by michangtao
 * @Date 2022/1/28 10:46
 * @Description
 */
@RequestMapping("/home")
@Controller
public class HomeController {

    @RequestMapping("/")
    public void cglib(){
        CglibProxy proxy = new CglibProxy(new UserManagerImpl());
        UserManager userManager = (UserManager) proxy.getProxyObj();
        userManager.addUser("mct","18");

    }
}
